package com.ysq.www.api.user.mapper;

import com.ysq.www.api.user.entity.GiveLike;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 点赞记录表 Mapper 接口
 * </p>
 *
 * @author dql
 * @since 2020-09-07
 */
public interface GiveLikeMapper extends BaseMapper<GiveLike> {

    /**
     * 根据内容id和用户id查询点赞记录
     * @param imId 内容id
     * @param userId 用户id
     * @return GiveLike
     */
    @Select("select * from t_give_like where status = 0 and type = 1 and content_id = #{imId} and user_id = #{userId}")
    GiveLike searchByUserId(@Param("imId") Integer imId,@Param("userId") Integer userId);

}
